ARG VERSION=latest
FROM dbeaver/cloudbeaver:${VERSION}

RUN echo '{"lang":"zh-cn","name":"CloudBeaver","short_name":"CloudBeaver","description":"CloudBeaver Community","start_url":"/#/","background_color":"#2a7cb4","theme_color":"#2a7cb4","orientation":"any","display":"standalone","icons":[{"src":"/favicon-32x32.png","sizes":"32x32"}]}' \
    > /opt/cloudbeaver/web/manifest.json

RUN sed -ie 's/<head>/<head><link rel="manifest" href=".\/manifest.json">/g' \
    /opt/cloudbeaver/web/index.html

CMD [ "./run-server.sh" ]

EXPOSE 8443